package com.xxx.user.dao.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xxx.user.domain.entity.UserRoleDO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserRoleMapper extends BaseMapper<UserRoleDO> {


    @Insert({
            "<script>",
            "INSERT INTO sys_user_role ",
            "(user_id, role_id )",
            "VALUES",
            "<foreach collection='list' item='item' separator=','>",
            " (",
            "  #{item.userId}, #{item.roleId} ",
            " )",
            "</foreach>",
            "</script>"
    })
    void batchInsert(@Param("list") List<UserRoleDO> list);

}




